package com.feng.config;

import com.feng.LinuxCondition;
import com.feng.WindowsCondition;
import com.feng.service.LinuxListService;
import com.feng.service.ListService;
import com.feng.service.WindowsListService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

/**
 * @description:
 * @author: lrf
 * @create: 2019-09-07
 **/
@Configuration
public class ConditionConfig {

    @Bean
    @Conditional(WindowsCondition.class)
    public ListService windowsListService() {
        return new WindowsListService();
    }


    @Bean
    @Conditional(LinuxCondition.class)
    public ListService linuxListService(){
        return new LinuxListService();
    }

}
